<template>
  <div>
    <span v-if="status === '0'">
      <a v-if="canAdd" @click="$emit('submit')"><CheckOutlined />提交</a>
      <a-divider v-if="canAdd && canEdit" type="vertical" />
      <a-divider v-if="canAdd && !canEdit && canDelete" type="vertical" />
      <a v-if="canEdit" @click="$emit('edit')"><EditOutlined />编辑</a>
      <a-divider v-if="canEdit && canDelete" type="vertical" />
      <a-popconfirm
        v-if="canDelete"
        title="确定删除吗？"
        okText="确定"
        cancelText="取消"
        @confirm="$emit('delete')"
      >
        <a><DeleteOutlined />删除</a>
      </a-popconfirm>
    </span>
  </div>
</template>

<script>
import {
  EditOutlined,
  DeleteOutlined,
  CheckOutlined,
} from "@ant-design/icons-vue";

export default {
  name: "RequireAuditTableOperation",
  emits: ["delete", "edit", "submit"],
  props: ["status", "canAdd", "canEdit", "canDelete"],
  components: {
    EditOutlined,
    DeleteOutlined,
    CheckOutlined,
  },
};
</script>
